package com.linkwedo.saas.project;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts2.interceptor.ServletRequestAware;

//import com.db.TbTask;
//import com.db.TbTaskDAO;
import com.linkwedo.saas.domain.Time;
import com.opensymphony.xwork2.ActionSupport;

public class LoadAllTimeAction extends ActionSupport implements ServletRequestAware{
	private static final long serialVersionUID = 8190003683775267839L;
	private javax.servlet.http.HttpServletRequest request;
	private TimeService TimeService;
	private String taskid;
	public String getTaskid() {
		return taskid;
	}

	public void setTaskid(String taskid) {
		this.taskid = taskid;
	}

	public TimeService getTimeService() {
		return TimeService;
	}

	public void setTimeService(TimeService TimeService) {
		this.TimeService = TimeService;
	}

	public void setServletRequest(HttpServletRequest request) {
		// TODO Auto-generated method stub
		this.request=request;
	}
	List list;
	public List getList() {
		return list;
	}

	public void setList(List list) {
		this.list = list;
	}


	public String execute() throws Exception {
		taskid=request.getParameter("tid");
		try{
		list=TimeService.findByTaskID(new Integer(taskid));
	 	for(Time pro:(List<Time>)list){
	 	 	System.out.println(pro.getName());
		}}catch(Exception e){
			e.printStackTrace();
		}
		System.out.println("list size"+list.size());
			return "SUCCESS";
	}
	
	}
